From: Jasper St. Pierre Date: Thu, 16 Aug 2012 17:49:35 +0000 (-0400) Subject: messageTray: Always close the tray when clicking outside of it X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6129 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4dfe3d21e10ec869b3073ba978335394e882db1b;p=gnome-shell.git messageTray: Always close the tray when clicking outside of it Even when a summary box pointer item is up. --- diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js index 8b04dbdad..4a72351bb 100644 --- a/js/ui/grabHelper.js +++ b/js/ui/grabHelper.js @@ -84,7 +84,14 @@ const GrabHelper = new Lang.Class({ }, get currentGrab() { - return this._grabStack[this._grabStack.length - 1] || {}; + if (!this._grabStack.length) + return {}; + + let idx = this._grabStack.length - 1; + while (idx >= 0 && this._grabStack[idx].untracked) + idx--; + + return this._grabStack[idx]; }, _findStackIndex: function(actor) { @@ -132,10 +139,13 @@ const GrabHelper = new Lang.Class({ // revert it back, and re-focus the previously-focused window (if // another window hasn't been explicitly focused before then). // - // + // If @params contains { untracked: true }, then it will be skipped + // when the grab helper ungrabs for you, or when calculating + // currentGrab. grab: function(params) { params = Params.parse(params, { actor: null, modal: false, + untracked: false, grabFocus: false, onUngrab: null }); diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index a52702a93..8b5286b00 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2213,6 +2213,7 @@ const MessageTray = new Lang.Class({ } this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child, + untracked: true, grabFocus: true, onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) }); this._lock();